package com.thinkmore.es.utils;

import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;

public class LogUtil {

    public static void print(SearchResponse response) {
        SearchHits hits = response.getHits();
        long totalCount = hits.getTotalHits().value;
        System.out.println("--------------------------------");
        //List<EsFile> list = new ArrayList<>((int) totalCount);
        for (SearchHit hit : hits.getHits()) {
            String json = hit.getSourceAsString();
            System.out.println(json);
            //list.add(JSON.parseObject(json, EsFile.class));
        }
    }
}
